/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.util.Date;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 销售单Entity
 *
 * @author HOHD
 * @version 2020-12-18
 */
@Table(name = "st_sale_bill_detail", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "product_name", attrName = "productName", label = "产品名称", queryType = QueryType.LIKE),
        @Column(name = "product_formula", attrName = "productFormula", label = "生产配方"),
        @Column(name = "unit", attrName = "unit", label = "单位"),
        @Column(name = "number", attrName = "number", label = "数量"),
        @Column(name = "rate", attrName = "rate", label = "税率"),
        @Column(name = "single_price", attrName = "singlePrice", label = "单价"),
        @Column(name = "reference_price", attrName = "referencePrice", label = "参考售价"),
        @Column(name = "money", attrName = "money", label = "金额"),
        @Column(name = "discount_price", attrName = "discountPrice", label = "优惠金额"),
        @Column(name = "prepare_date", attrName = "prepareDate", label = "备货日期"),
        @Column(name = "ramarks", attrName = "ramarks", label = "备注"),
        @Column(name = "parent_id", attrName = "parentId.id", label = "父id"),
}, orderBy = "a.id ASC"
)
public class StSaleBillDetail extends DataEntity<StSaleBillDetail> {

    private static final long serialVersionUID = 1L;
    private String productName;        // 产品名称
    private String productFormula;        // 生产配方
    private String unit;        // 单位
    private Integer number;        // 数量
    private String rate;        // 税率
    private BigDecimal singlePrice;        // 单价
    private BigDecimal referencePrice;        // 参考售价
    private BigDecimal money;        // 金额
    private BigDecimal discountPrice;        // 优惠金额
    private Date prepareDate;        // 备货日期
    private String ramarks;        // 备注
    private StSaleBill parentId;        // 父id 父类
    private String billNo;
    private String billDate;

    private StCustomRecord custom;

    private BigDecimal saleMoney;

    private Integer hasOut;
    private Integer notOut;

    private String groupDate;

    private BigDecimal averagePrice;

    public BigDecimal getAveragePrice() {
        return averagePrice;
    }

    public void setAveragePrice(BigDecimal averagePrice) {
        this.averagePrice = averagePrice;
    }

    public String getGroupDate() {
        return groupDate;
    }

    public void setGroupDate(String groupDate) {
        this.groupDate = groupDate;
    }

    public Integer getHasOut() {
        return hasOut;
    }

    public StCustomRecord getCustom() {
        return custom;
    }

    public void setCustom(StCustomRecord custom) {
        this.custom = custom;
    }

    public void setHasOut(Integer hasOut) {
        this.hasOut = hasOut;
    }

    public Integer getNotOut() {
        return notOut;
    }

    public void setNotOut(Integer notOut) {
        this.notOut = notOut;
    }

    public BigDecimal getSaleMoney() {
        return saleMoney;
    }

    public void setSaleMoney(BigDecimal saleMoney) {
        this.saleMoney = saleMoney;
    }

    private StProductRecord stProductRecord;

    public StProductRecord getStProductRecord() {
        return stProductRecord;
    }

    public void setStProductRecord(StProductRecord stProductRecord) {
        this.stProductRecord = stProductRecord;
    }

    public StSaleBillDetail() {
        this(null);
    }


    public StSaleBillDetail(StSaleBill parentId) {
        this.parentId = parentId;
    }

    public String getBillDate() {
        return billDate;
    }

    public void setBillDate(String billDate) {
        this.billDate = billDate;
    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    @Length(min = 0, max = 36, message = "产品名称长度不能超过 36 个字符")
    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Length(min = 0, max = 36, message = "生产配方长度不能超过 36 个字符")
    public String getProductFormula() {
        return productFormula;
    }

    public void setProductFormula(String productFormula) {
        this.productFormula = productFormula;
    }

    @Length(min = 0, max = 36, message = "单位长度不能超过 36 个字符")
    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Length(min = 0, max = 36, message = "税率长度不能超过 36 个字符")
    public String getRate() {
        return rate;
    }

    public void setRate(String rate) {
        this.rate = rate;
    }

    public BigDecimal getSinglePrice() {
        return singlePrice;
    }

    public void setSinglePrice(BigDecimal singlePrice) {
        this.singlePrice = singlePrice;
    }

    public BigDecimal getReferencePrice() {
        return referencePrice;
    }

    public void setReferencePrice(BigDecimal referencePrice) {
        this.referencePrice = referencePrice;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public BigDecimal getDiscountPrice() {
        return discountPrice;
    }

    public void setDiscountPrice(BigDecimal discountPrice) {
        this.discountPrice = discountPrice;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getPrepareDate() {
        return prepareDate;
    }

    public void setPrepareDate(Date prepareDate) {
        this.prepareDate = prepareDate;
    }

    @Length(min = 0, max = 500, message = "备注长度不能超过 500 个字符")
    public String getRamarks() {
        return ramarks;
    }

    public void setRamarks(String ramarks) {
        this.ramarks = ramarks;
    }

    @Length(min = 0, max = 36, message = "父id长度不能超过 36 个字符")
    public StSaleBill getParentId() {
        return parentId;
    }

    public void setParentId(StSaleBill parentId) {
        this.parentId = parentId;
    }

}